using System;
using System.Collections.Generic;
using Volo.Abp.EventBus.Distributed;
using UserManagementService.Organizations;

namespace UserManagementService.Events;

/// <summary>
/// 组织创建事件
/// </summary>
public class OrganizationCreatedEto
{
    public Guid OrganizationId { get; set; }
    public string Code { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public OrganizationType Type { get; set; }
    public Guid? ParentId { get; set; }
    public Guid? TenantId { get; set; }
    public DateTime CreationTime { get; set; }
    public string? CreatedBy { get; set; }
}

/// <summary>
/// 组织更新事件
/// </summary>
public class OrganizationUpdatedEto
{
    public Guid OrganizationId { get; set; }
    public string Code { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public OrganizationType Type { get; set; }
    public Guid? ParentId { get; set; }
    public Guid? TenantId { get; set; }
    public DateTime ModificationTime { get; set; }
    public string? ModifiedBy { get; set; }
}

/// <summary>
/// 组织删除事件
/// </summary>
public class OrganizationDeletedEto
{
    public Guid OrganizationId { get; set; }
    public string Code { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public Guid? TenantId { get; set; }
    public DateTime DeletionTime { get; set; }
    public string? DeletedBy { get; set; }
    public string? DeletionReason { get; set; }
}

/// <summary>
/// 组织移动事件
/// </summary>
public class OrganizationMovedEto
{
    public Guid OrganizationId { get; set; }
    public string Code { get; set; } = string.Empty;
    public string Name { get; set; } = string.Empty;
    public Guid? OldParentId { get; set; }
    public Guid? NewParentId { get; set; }
    public int OldLevel { get; set; }
    public int NewLevel { get; set; }
    public Guid? TenantId { get; set; }
    public DateTime MoveTime { get; set; }
    public string? MovedBy { get; set; }
}

/// <summary>
/// 组织成员加入事件
/// </summary>
public class OrganizationMemberJoinedEto
{
    public Guid OrganizationId { get; set; }
    public string OrganizationName { get; set; } = string.Empty;
    public Guid UserId { get; set; }
    public string UserName { get; set; } = string.Empty;
    public string? Position { get; set; }
    public bool IsManager { get; set; }
    public Guid? TenantId { get; set; }
    public DateTime JoinTime { get; set; }
    public string? AddedBy { get; set; }
}

/// <summary>
/// 组织成员离开事件
/// </summary>
public class OrganizationMemberLeftEto
{
    public Guid OrganizationId { get; set; }
    public string OrganizationName { get; set; } = string.Empty;
    public Guid UserId { get; set; }
    public string UserName { get; set; } = string.Empty;
    public string? Position { get; set; }
    public Guid? TenantId { get; set; }
    public DateTime LeaveTime { get; set; }
    public string? RemovedBy { get; set; }
    public string? LeaveReason { get; set; }
}